package com.minimalist.common.entity.basic.po;

import com.mybatisflex.annotation.Table;


import java.io.Serial;
import java.io.Serializable;

/**
 * 角色与部门关联表 1角色-N部门 实体类。
 *
 * @author 小太阳
 * @since 2024-10-18
 */

@Table(value = "m_role_dept")
public class MRoleDept implements Serializable{

    public MRoleDept() {
    }

    public MRoleDept(Long roleId, Long deptId) {
        this.roleId = roleId;
        this.deptId = deptId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public static MRoleDeptBuilder builder() {
        return new MRoleDeptBuilder();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MRoleDept mRoleDept = (MRoleDept) o;
        return java.util.Objects.equals(roleId, mRoleDept.roleId) &&
               java.util.Objects.equals(deptId, mRoleDept.deptId);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(roleId, deptId);
    }

    public static class MRoleDeptBuilder {
        private Long roleId;
        private Long deptId;

        public MRoleDeptBuilder roleId(Long roleId) {
            this.roleId = roleId;
            return this;
        }

        public MRoleDeptBuilder deptId(Long deptId) {
            this.deptId = deptId;
            return this;
        }

        public MRoleDept build() {
            return new MRoleDept(roleId, deptId);
        }
    }

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 角色ID
     */
    private Long roleId;

    /**
     * 部门ID
     */
    private Long deptId;

}
